import React from 'react'
import './SecKill.less'
import { $pre } from "../../../../http/http";
import { Button } from 'antd-mobile'
import { withRouter } from 'react-router-dom'

function SecKill(props) {
  
  let { getskillist, timeString } = props
 

  return (
    <div className='seckill'>
     
     {/* <div className='seckill  '><div className="seckill_time">超级秒杀&nbsp;&nbsp;&nbsp;<span>{timeString.day}天</span><span>{timeString.hour}时</span><span>{timeString.minute}分</span><span>{timeString.second}秒</span></div></div> */}
     

     {getskillist.length == 0 ? <div>暂无数据</div> :
        getskillist.map((item) => {
          return (
            <div key={item.id}
              onClick={() => { props.history.push(`/detail/${item.id}/1`) }}
            >
              <div className='seckill_content'>
                <div className='seckill_left'>
                  <img src={$pre + item.img} alt={item.goodsname} />
                </div>

                <div className='seckill_right'>
                  <h1>{item.goodsname}</h1>
                  <h4>剩余{10}件</h4>
                  <h4>每人限购1件</h4>
                  <p>
                    <i>现价：{item.price}元</i>
                    <i>原价：{item.market_price}元</i>
                    <Button color='danger'>马上抢</Button>
                  </p>
                </div>
              </div>
            </div>

          )
        })
      }
    </div>
  )
}
export default withRouter(SecKill)
